home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / 1.098 / include / sys / resource.h < prev    next >
C/C++ Source or Header  |  1989-07-18  |  2KB  |  70 lines

  1. /*
  2.  * Copyright (c) 1982, 1986 Regents of the University of California.
  3.  * All rights reserved.  The Berkeley software License Agreement
  4.  * specifies the terms and conditions for redistribution.
  5.  *
  6.  *    @(#)resource.h    7.1 (Berkeley) 6/4/86
  7.  */
  8.  
  9. #ifndef _RESOURCE
  10. #define _RESOURCE
  11.  
  12. /*
  13.  * Process priority specifications to get/setpriority.
  14.  */
  15. #define    PRIO_MIN    -20
  16. #define    PRIO_MAX    20
  17.  
  18. #define    PRIO_PROCESS    0
  19. #define    PRIO_PGRP    1
  20. #define    PRIO_USER    2
  21.  
  22. /*
  23.  * Resource utilization information.
  24.  */
  25.  
  26. #define    RUSAGE_SELF    0
  27. #define    RUSAGE_CHILDREN    -1
  28.  
  29. struct    rusage {
  30.     struct timeval ru_utime;    /* user time used */
  31.     struct timeval ru_stime;    /* system time used */
  32.     long    ru_maxrss;
  33. #define    ru_first    ru_ixrss
  34.     long    ru_ixrss;        /* integral shared memory size */
  35.     long    ru_idrss;        /* integral unshared data " */
  36.     long    ru_isrss;        /* integral unshared stack " */
  37.     long    ru_minflt;        /* page reclaims */
  38.     long    ru_majflt;        /* page faults */
  39.     long    ru_nswap;        /* swaps */
  40.     long    ru_inblock;        /* block input operations */
  41.     long    ru_oublock;        /* block output operations */
  42.     long    ru_msgsnd;        /* messages sent */
  43.     long    ru_msgrcv;        /* messages received */
  44.     long    ru_nsignals;        /* signals received */
  45.     long    ru_nvcsw;        /* voluntary context switches */
  46.     long    ru_nivcsw;        /* involuntary " */
  47. #define    ru_last        ru_nivcsw
  48. };
  49.  
  50. /*
  51.  * Resource limits
  52.  */
  53. #define    RLIMIT_CPU    0        /* cpu time in milliseconds */
  54. #define    RLIMIT_FSIZE    1        /* maximum file size */
  55. #define    RLIMIT_DATA    2        /* data size */
  56. #define    RLIMIT_STACK    3        /* stack size */
  57. #define    RLIMIT_CORE    4        /* core file size */
  58. #define    RLIMIT_RSS    5        /* resident set size */
  59.  
  60. #define    RLIM_NLIMITS    6        /* number of resource limits */
  61.  
  62. #define    RLIM_INFINITY    0x7fffffff
  63.  
  64. struct rlimit {
  65.     int    rlim_cur;        /* current (soft) limit */
  66.     int    rlim_max;        /* maximum value for rlim_cur */
  67. };
  68.  
  69. #endif /* _RESOURCE */
  70.